<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html><!-- InstanceBegin template="/Templates/Function Info.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<!-- InstanceBeginEditable name="doctitle" -->
<title>onItem (Callback) </title>
<!-- InstanceEndEditable -->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<!-- InstanceBeginEditable name="head" --><!-- InstanceEndEditable -->
<style type="text/css">
<!--
.style3 {font-size: medium}
-->
</style>

<link href="../../WinXStyles.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style1 {
	font-size: x-large;
	font-family: Verdana, Arial, Helvetica, sans-serif;
}
.style2 {
	font-size: large;
	font-family: Verdana, Arial, Helvetica, sans-serif;
}
-->
</style>
</head>

<body>
<h1 class="style1"><img src="../../WinX48.png" width="48" height="48" align="absmiddle"> <!-- InstanceBeginEditable name="title" -->onItem (Callback) <!-- InstanceEndEditable --></h1>
<hr>

<!-- InstanceBeginEditable name="Prototype" -->
<p>onItem (idControl, event, parameter) </p>
<!-- InstanceEndEditable --><!-- InstanceBeginEditable name="Description" -->
<p>This callback is invoked when the user performs an action on an item in a list view or tree view control </p>
<!-- InstanceEndEditable -->
<table width="80%" border="1" cellpadding="0" cellspacing="0">
  <tr bgcolor="#CCCCCC">
    <th width="24%"><span class="style3">Parameter</span></th>
    <th width="76%"><span class="style3">Description</span></th>
  </tr>
  <!-- InstanceBeginRepeat name="Parameter Table" --><!-- InstanceBeginRepeatEntry -->
  <tr bgcolor="#E8E8E8">
    <td><!-- InstanceBeginEditable name="Parameter" -->idControl<!-- InstanceEndEditable --></td>
    <td><!-- InstanceBeginEditable name="Description" -->The unique id of the control that triggered the callback <!-- InstanceEndEditable --></td>
  </tr>
  <!-- InstanceEndRepeatEntry --><!-- InstanceBeginRepeatEntry -->
  <tr bgcolor="#E8E8E8">
    <td><!-- InstanceBeginEditable name="Parameter" -->event<!-- InstanceEndEditable --></td>
    <td><!-- InstanceBeginEditable name="Description" -->The event code, see remarks for a list of event codes <!-- InstanceEndEditable --></td>
  </tr>
  <!-- InstanceEndRepeatEntry --><!-- InstanceBeginRepeatEntry -->
  <tr bgcolor="#E8E8E8">
    <td><!-- InstanceBeginEditable name="Parameter" -->param<!-- InstanceEndEditable --></td>
    <td><!-- InstanceBeginEditable name="Description" -->This parameter is defined for some event codes <!-- InstanceEndEditable --></td>
  </tr>
  <!-- InstanceEndRepeatEntry --><!-- InstanceEndRepeat -->
</table>
<h3>Returns</h3>
<!-- InstanceBeginEditable name="Return Info" -->
<p>0</p>
<!-- InstanceEndEditable -->
<h3>Remarks</h3>
<!-- InstanceBeginEditable name="Remarks" -->
<p>This is a callback function. You must supply it yourself. To register this callback, use the <a href="WinXRegOnItem.htm">WinXRegOnItem</a> function.</p>
<p>The event parameter will be one of these constants:</p>
<dl>
  <dt>$$NM_CLICK</dt>
  <dd>A single click of the left mouse button</dd>
  <dt>$$NM_DBLCLK</dt>
  <dd>A double click of the left mouse button</dd>
  <dt>$$NM_RCLICK</dt>
  <dd>A single click of the right mouse button</dd>
  <dt>$$NM_RDBLCLK</dt>
  <dd>A double click of the right mouse button</dd>
  <dt>$$NM_RETURN</dt>
  <dd>A press of the return or enter key </dd>
  <dt>$$NM_HOVER</dt>
  <dd>The user hovered the mouse over the control</dd>
  <dt>$$NM_KEYDOWN</dt>
  <dd>A press of any key besides return or enter. If the event parameter is $$NM_KEYDOWN the param parameter will be the VK code of the key that was pressed. </dd>
</dl>
<!-- InstanceEndEditable -->
<h3>Examples</h3>
<table width="80%"  border="0">
  <tr>
    <td bgcolor="#C6C6FF"><!-- InstanceBeginEditable name="Example Code" -->
      <p class="codeStyle">' A very simple onItem callback. Detects single clicks <br>
      FUNCTION onItem (idControl, event, param)</p>
      <blockquote>
        <p class="codeStyle">IF event = $$NM_CLICK THEN PRINT &quot;CLICK!&quot; </p>
      </blockquote>
      <p class="codeStyle">END FUNCTION       </p>
    <!-- InstanceEndEditable --></td>
  </tr>
</table>

<h2 class="style2">Related Links</h2>
<!-- InstanceBeginEditable name="Related Links" -->
<p><a href="../../WinX%20Programmer%27s%20Guide/Controls.htm/listviews.htm">List View Controls</a><br>
<a href="../../WinX%20Programmer%27s%20Guide/Controls.htm/treeview.htm">Tree View Controls</a><br>
<a href="WinXRegOnItem.htm">WinXRegOnItem</a></p>
<!-- InstanceEndEditable -->
</body>
<!-- InstanceEnd --></html>
